package com.imchen.demov4;

import com.kuaiyouxi.gamepad.sdk.shell.assist.SDKAssist;

import java.util.HashMap;

public class AvoidHomeInsert {

    private static long startAt = System.currentTimeMillis();
    private static long rewardShowAt = 0;
    private static long fullShowAt = 0;
    private static long insertShowAt = 0;
    private static int adType = 1;
    public static String[] adTypes = new String[]{"reward", "full", "insert"};
    public static int[] showInterval = new int[]{-1, 20, 5};

    public static HashMap<String, Integer> adRegualrMap;


    static {
        adRegualrMap = new HashMap<>();
        adRegualrMap.put("reward", -1);
        adRegualrMap.put("full", 20);
        adRegualrMap.put("insert", 5);
    }


    public static void showAvoidHomeInsert() {
        if (System.currentTimeMillis() - startAt > 20 * 1000) {
//            showAt = System.currentTimeMillis();
//            if (adType==2&&System.currentTimeMillis() - showAt<25*1000){
//                adType =1;
//                SDKAssist.showLog();
//            }else {
//                adType=2;
//                SDKAssist.showVideoAd();
            showWithRegular();
//            }
        }
    }

    public static void showWithRegular() {
        for (HashMap.Entry<String, Integer> entry : adRegualrMap.entrySet()
        ) {
            String adType = entry.getKey();
            int showInterval = entry.getValue();
            
        }
    }

    public static void showAdByType(String adType) {
        switch (adType) {
            case "reward":
                SDKAssist.showVideoAd();
                break;
            case "full":
                SDKAssist.showFull();
                break;
            case "insert":
                SDKAssist.showLog();
                break;
        }
    }

}
